<div class="bg-light lter b-b wrapper-md">
    <h4 class="m-n font-thin">账号管理</h4>
    <!--<button ui-sref="app.accountInternal" class="btn-back btn btn-dark btn-sm btn-rounded">-->
        <!--返回-->
    <!--</button>-->
</div>
<div class="wrapper-md ng-scope" ng-controller="createAccountCtrl">

    <div class="panel panel-default">
        <div class="panel-heading font-bold">
            创建账号
        </div>
        <div class="panel-body">
            <form name="systemUserForm" class="form-horizontal form-validation" method="post" ng-submit="createAccount()">

                <div class="form-group">
                    <label class="col-sm-2 control-label font-bold">账号/手机</label>
                    <div class="col-sm-5">
                        <div class="input-group">
                            <span class="input-group-btn">
                                <button class="btn btn-default" type="button">+86</button>
                            </span>
                            <input name="mobilePhone" ng-model="systemUser.mobilePhone" type="text" class="form-control" required>
                        </div>
                    </div>
                    <div class="col-sm-5 form-text">
                        <span class="text-muted h6">*目前支持大陆手机号码</span>
                    </div>
                </div>
                <div class="form-group pull-in clearfix">
                    <label class="col-sm-2 control-label font-bold">初始密码</label>
                    <div class="col-sm-5">
                        <input type="password" class="form-control" name="password" ng-model="systemUser.password" ng-minlength="6" ng-maxlength="16" required>
                        <div class="m-t-xs" ng-if="systemUserForm.password.$touched">
                            <span class="text-danger h6" ng-if="systemUserForm.password.$error.required">初始密码不允许为空</span>
                            <span class="text-danger h6" ng-if="systemUserForm.password.$error.minlength">初始密码长度必须大于6位</span>
                            <span class="text-danger h6" ng-if="systemUserForm.password.$error.maxlength">初始密码长度必须小于16位</span>
                        </div>
                    </div>
                    <div class="col-sm-5 form-text" >
                        <span class="text-muted h6">*密码长度必须要6-16位</span>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label font-bold">确认密码</label>
                    <div class="col-sm-5">
                        <input type="password" class="form-control" name="confirmPassword" required
                               ng-model="systemUser.confirmPassword" ui-validate=" '$value==systemUser.password'" ng-minlength="6" ng-maxlength="16" ui-validate-watch=" 'systemUser.password' ">
                        <div class="m-t-xs" ng-if="systemUserForm.confirmPassword.$touched">
                            <span class="text-danger h6" ng-if="systemUserForm.confirmPassword.$error.required">确认密码不允许为空</span>
                            <span class="text-danger h6" ng-if="systemUserForm.confirmPassword.$error.minlength">确认密码长度必须大于6位</span>
                            <span class="text-danger h6" ng-if="systemUserForm.confirmPassword.$error.maxlength">确认密码长度必须小于16位</span>
                            <span class="text-danger h6" ng-if="systemUser.password!=systemUser.confirmPassword">两次密码不相同</span>
                        </div>
                    </div>
                    <div class="col-sm-5 form-text">
                        <span class="text-muted h6">*确认密码是必填的</span>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label font-bold">姓名</label>
                    <div class="col-sm-5">
                        <input name="name" ng-model="systemUser.name" type="text" class="form-control" required>
                        <div class="m-t-xs" ng-if="systemUserForm.name.$touched">
                            <span class="text-danger h6" ng-if="systemUserForm.name.$error.required">名字不允许为空</span>
                        </div>
                    </div>
                    <div class="col-sm-5 form-text">
                        <span class="text-muted h6">*姓名是必填的</span>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label font-bold">性别</label>
                    <div class="col-sm-5">
                        <div class="radio">
                            <label class="i-checks i-checks-sm">
                                <input type="radio" name="gender" ng-model="systemUser.gender" ng-value=1>
                                <i></i>
                                先生
                            </label>
                            <label class="i-checks i-checks-sm">
                                <input type="radio" name="gender" ng-model="systemUser.gender" ng-value=0>
                                <i></i>
                                女士
                            </label>
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label font-bold">Email</label>
                    <div class="col-sm-5">
                        <input name="email" ng-model="systemUser.email" type="email" class="form-control" required>
                        <div class="m-t-xs" ng-if="systemUserForm.email.$touched">
                            <span class="text-danger h6" ng-if="systemUserForm.email.$error.required">邮箱不允许为空</span>
                            <span class="text-danger h6" ng-if="systemUserForm.email.$error.email">请输入正确的邮箱号码</span>
                        </div>
                    </div>
                    <div class="col-sm-5 form-text">
                        <span class="text-muted h6">*用于找回密码，接受认证信息等</span>
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-sm-offset-2 col-sm-5">
                        <div class="checkbox">
                            <label class="i-checks i-checks-sm">
                                <input type="checkbox" ng-model="systemUser.isUpdatePassword" ng-true-value="1" ng-false-value="0">
                                <i></i>
                                初始登陆需修改密码
                            </label>
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label font-bold">角色设置</label>
                    <div class="col-md-5">
                        <div class="inline m-r" ng-repeat="item in roles">
                            <div class="inline checkbox">
                                <label class="i-checks i-checks-sm h5">
                                    <input type="checkbox" ng-checked="item.isSelect==1" ng-click="checkItem(item)">
                                    <i></i>
                                    {{item.name}}
                                </label>
                            </div>
                            <i class="inline m-l-xs fa fa-question-circle text-muted pos-rlt h6" popover-placement="top" popover="包含 {{item.functionName}} 功能" popover-trigger="mouseenter" ng-if="item.functionName!=null"></i>
                            <i class="inline m-l-xs fa fa-question-circle text-muted pos-rlt h6" popover-placement="top" popover="暂无功能" popover-trigger="mouseenter" ng-if="item.functionName==null"></i>
                        </div>
                    </div>
                </div>
                <div class="line line-dashed b-b line-lg pull-in"></div>
                <div class="form-group">
                    <div class="col-sm-4 col-sm-offset-2">
                        <button type="submit" class="btn btn-success" ng-disabled="systemUserForm.$invalid">保存</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>